import Mock from "mockjs";

const filterList = {
    "areaList": [
        {
            "key": 0,
            "label": "未知4242"
        },
        {
            "key": 1,
            "label": "北京"
        },
        {
            "key": 2,
            "label": "郑州"
        },
        {
            "key": 3,
            "label": "西安"
        },
        {
            "key": 4,
            "label": "武汉"
        },
        {
            "key": 5,
            "label": "南昌"
        },
        {
            "key": 6,
            "label": "石家庄"
        },
        {
            "key": 7,
            "label": "太原"
        },
        {
            "key": 8,
            "label": "长沙"
        },
        {
            "key": 9,
            "label": "长春"
        }
    ],
    "gradeList": [
        {
            "key": 11,
            "label": "一年级"
        },
        {
            "key": 12,
            "label": "二年级"
        },
        {
            "key": 13,
            "label": "三年级"
        },
        {
            "key": 14,
            "label": "四年级"
        },
        {
            "key": 15,
            "label": "五年级"
        },
        {
            "key": 16,
            "label": "六年级"
        },
        {
            "key": 21,
            "label": "初一"
        },
        {
            "key": 22,
            "label": "初二"
        },
        {
            "key": 23,
            "label": "初三"
        },
        {
            "key": 31,
            "label": "高一"
        },
        {
            "key": 32,
            "label": "高二"
        },
        {
            "key": 33,
            "label": "高三"
        },
    ],
    "departmentList": [
        {
            "key": 10,
            "label": "小学",
        }, {
            "key": 20,
            "label": "初中",
        }, {
            "key": 30,
            "label": "高中",
        }
    ],
    "subjectList": [
        {
            "key": 1,
            "label": "语文",
        }, {
            "key": 2,
            "label": "数学",
        }, {
            "key": 3,
            "label": "英语",
        }, {
            "key": 4,
            "label": "物理",
        }, {
            "key": 5,
            "label": "化学",
        }, {
            "key": 6,
            "label": "生物",
        }, {
            "key": 7,
            "label": "历史",
        }, {
            "key": 8,
            "label": "政治",
        }, {
            "key": 9,
            "label": "地理",
        }
    ]
};


export default {
    "POST /api/crud/getFilter": (req, res) => {
        res.send({
            "code": 0,
            "data": filterList
        });
    },
    "POST /api/crud/getList": (req, res) => {
        const {pager} = req.body;
        res.send({
            "code": 0,
            "data": Mock.mock({
                "list|100": [
                    {
                        "id|+1": 1,
                        "area|1": ["北京", "武汉", "郑州", "西安", "未知"],
                        "assistantName|1-10": "w",
                        "attendRatio|0-1": 0.19,
                        "avgLessonTime|1-100": 100,
                        "avgListenTime|1-100": 100,
                        "avgPlayBackTime|1-100": 100,
                        "beginTime": "2019/12/12 12:12",
                        "clazzBizNumber|+1": 1,
                        "clazzLessonName|1-6": "x",
                        "clazzName|1-6": "z",
                        "correctRatio|0-1": 0.19,
                        "courseBizNumber|+1": 1,
                        "courseName|1-6": "u",
                        "currentCount|1-100": 100,
                        "currentSubmit|1-100": 100,
                        "departmentNumber|1": [10, 20, 30],
                        "departmentName|1-6": "i",
                        "effectiveListenTime|1-100": 100,
                        "effectivePlayBackRatio|0-1": 0.19,
                        "effectiveRatio|0-1": 0.19,
                        "firstFinshRatio|0-1": 0.19,
                        "gradeNumber|1": [11, 12, 13, 14, 15, 16, 21, 22, 23, 31, 32, 33],
                        "gradeName|1-6": "o",
                        "index|+1": 1,
                        "length|1-100": 100,
                        "listenRatio|0-1": 0.19,
                        "listenTime|1-100": 100,
                        "liveQuesttionRatio|0-1": 0.19,
                        "liveQuesttionRightRatio|0-1": 0.19,
                        "modifyRatio|0-1": 0.19,
                        "notCorrectCount|1-100": 100,
                        "openLessonTime|1-100": 100,
                        "playBackRatio|0-1": 0.19,
                        "shoudModifyCount|1-100": 100,
                        "sourceType|1-6": "p",
                        "subclazzBizNumber|+1": 1,
                        "subclazzName|1-6": "q",
                        "subjectName|1-6": "t",
                        "subjectNumber|1-6": "t",
                        "submitRatio|0-1": 0.19,
                        "teacherName|1-6": "v",
                        "complehensiveCount|1-100000": 1,
                        "complehensiveRatio|0-1": 0.19,
                        "complehensivePrice|1-100000": 1,
                    }
                ],
            }),
            "pager": pager || {
                "current": 1,
                "pageSize": 10,
                "total": 100
            }
        });
    },
    "POST /api/crud/save": {"code": 0},
    "POST /api/crud/del": {"code": 0},
    "POST /api/crud/upload": {"code": 0, "data": {"fid": 123,"fileName": "1.png"}},
};
